import { CoolController, BaseController } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { FollowUserInfoEntity } from '../../entity/info'; 
import { FollowUserInfoService } from '../../service/infoType'; 

/**
 * follow模块-用户关注信息
 */
@CoolController({
  prefix: "/apid/follow",
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: FollowUserInfoEntity,
  service: FollowUserInfoService,
  pageQueryOp: {
    keyWordLikeFields: ['remark', 'group', 'source'],
    fieldEq: ['status', 'type'],
  }
})
export class AdminFollowUserInfoController extends BaseController {
    @Inject()
    followUserInfoService: FollowUserInfoService;

    @Post('/updateFollow', { summary: '收藏' })
    async updateFollow(@Body() queryData: any) {
      return this.ok(await this.followUserInfoService.updateFollow(queryData));
    }
  
    @Get('/getFollow', { summary: '收藏' })
    async getFollow(@Query() queryData: any) {
      return this.ok(await this.followUserInfoService.getFollow(queryData));
    }

}
